-
Notifications
You must be signed in to change notification settings - Fork 841
Add regex support for textfield on lit renderer #605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ging on-the-wire a2UI JSON and actions
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
… into md-componentslistagent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This is a substantial pull request that adds regex validation to text fields, enhances the MultipleChoice component with chip and filterable layouts, and introduces a comprehensive component gallery sample. The new features are well-implemented and the gallery is a valuable addition for demonstration and testing. My review includes suggestions to improve code maintainability, robustness, and style consistency in a few areas, such as simplifying redundant logic, refactoring hardcoded values, and making agent-side dispatching more robust.
gspencergoog
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a rubber stamp: I'm not reviewing the web code, since that's not my specialty.
|
Also, please remember to fill in the PR description template! It's useful when looking back at what has landed. Just the title is not enough information, at the very least this needs a description and to be linked to an issue on the repo! |
google#605 accidentally broke the v0.9/standard_catalog.json. This commit fixes the invalid JSON schema and reformats it.
* fix contact sample * Fix dropdown and make it multi-choice * Add a new component_gallery sample agent and client that allows debugging on-the-wire a2UI JSON and actions * Update samples/client/lit/component_gallery/README.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * fix modal * Create new 0.8.2 version of the spec to support filtering and types for dropdown * Add regex for textfield in lit. * Simplify diff by reverting unrelated changes to icon.ts and checkbox.ts * review fixes * fix review comments --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Description
This PR introduces Regex Validation for the TextField component and standardizes the
MultipleChoice
component styling mechanism.
Key Changes
Regex Validation (TextField):
Added validationRegexp property to the TextField schema in both v0.8 (
standard_catalog_definition.json
) and v0.9 (
standard_catalog.json
).
Implemented client-side validation logic in the Lit renderer (text-field.ts). The field now validates input against the provided regex pattern and displays an error state if the pattern does not match.
Updates the input to leverage the native HTML pattern attribute for accessibility and built-in validation support.
Added a "TextField (Regex)" example to the Component Gallery sample to demonstrate functionality.
Standardization (
MultipleChoice
):
Removed the non-standard displayStyle property from the
MultipleChoice
renderer.
Standardized on the variant property (values: "checkbox" | "chips") to control the visual presentation, aligning the renderer with the specification.
Refactored hardcoded colors in
MultipleChoice
to use the CSS variable var(--md-sys-color-secondary-container-high) for better theming support.
Sample Updates:
Updated the Component Gallery theme to define the new
MultipleChoice
hover color variable locally, ensuring the sample looks correct without polluting the core shell theme.
Pre-launch Checklist
If you need help, consider asking for advice on the discussion board.